<%@ include file="/common/taglibs.jsp"%>

<head>
    <title><fmt:message key="clientDetail.title"/></title>
    <meta name="heading" content="<fmt:message key='clientDetail.heading'/>"/>
</head>

<s:form id="clientForm" action="saveClient" method="post" validate="true">
    <li style="display: none">
        <s:hidden key="client.id"/>
    </li>
    <s:textfield key="client.address1" required="false" cssClass="text medium"/>
    <s:textfield key="client.address2" required="false" cssClass="text medium"/>
    <s:textfield key="client.city" required="false" cssClass="text medium"/>
    <s:textfield key="client.zip" required="false" cssClass="text medium"/>
<li>
    <s:checkbox key="client.contracted" cssClass="checkbox" theme="simple"/>
    <!-- For some reason, key prints out the raw value for the label (i.e. true) instead of the i18n key: https://issues.apache.org/struts/browse/WW-1958-->
    <s:label for="clientForm_client_contracted" value="%{getText('client.contracted')}" cssClass="choice desc" theme="simple"/>
</li>
<li>
    <s:checkbox key="client.primeContractor" cssClass="checkbox" theme="simple"/>
    <!-- For some reason, key prints out the raw value for the label (i.e. true) instead of the i18n key: https://issues.apache.org/struts/browse/WW-1958-->
    <s:label for="clientForm_client_primeContractor" value="%{getText('client.primeContractor')}" cssClass="choice desc" theme="simple"/>
</li>
    <s:textfield key="client.name" required="true" cssClass="text medium"/>
    <s:textfield key="client.state" required="false" cssClass="text medium"/>

    <li class="buttonBar bottom">
        <s:submit cssClass="button" method="save" key="button.save" theme="simple"/>
        <c:if test="${not empty client.id}">
            <s:submit cssClass="button" method="delete" key="button.delete"
                onclick="return confirmDelete('Client')" theme="simple"/>
        </c:if>
        <s:submit cssClass="button" method="cancel" key="button.cancel" theme="simple"/>
    </li>
</s:form>

<script type="text/javascript">
    Form.focusFirstElement($("clientForm"));
</script>
